package com.obelisco.modelo.dao.hibernate;

import java.io.Serializable;
import java.util.List;

import com.obelisco.modelo.dao.IRolDAO;
import com.obelisco.modelo.data.Rol;

public class RolDAO extends HibernateDAO<Rol>  implements IRolDAO {

	public Rol findByPK(Serializable clave) {
		try {
        	Rol data = (Rol) getHibernateTemplate().load(Rol.class,clave);
			return data.getEstado().equals("B") ?  null : data;        	
        } catch (RuntimeException re) {
            throw re;
        }		
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<Rol> loadAll() {
		return getHibernateTemplate().find("from Rol rol where rol.estado != 'B'");
	}

	@Override
	public void delete(Rol objeto) {
		// TODO Auto-generated method stub

	}

	@Override
	public void save(Rol objeto) {
		// TODO Auto-generated method stub

	}

	@Override
	public List<Rol> findByProperty(String propertyName, Object value) {
		// TODO Auto-generated method stub
		return null;
	}

}
